(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/taskScrollview.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, 'cdf83jujElG2IWI77Magtr+', 'taskScrollview', __filename);
// Script/taskScrollview.js

"use strict";

var _XmlHttpTool = require("./XmlHttpTool");

var _XmlHttpTool2 = _interopRequireDefault(_XmlHttpTool);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var taskItem = cc.Class({
    name: 'taskItem',
    properties: {

        rankName: cc.String,
        rankheadimage: cc.Integer,
        status: cc.String

    }
});

cc.Class({
    extends: cc.Component,

    properties: {

        items: {
            default: [],
            type: taskItem
        },
        itemPrefab: cc.Prefab,
        bageAllScrollView: cc.Node,
        bageCloseBtn: cc.Button,
        emptyView: cc.Node,
        emptyLabel: cc.Node,
        moretitleSprite: cc.Node

    },

    closeClick: function closeClick() {

        var changebig = cc.scaleTo(0.02, 1.2);

        var finish = cc.callFunc(function () {

            var that = this;
            var changesmail = cc.scaleTo(0.08, 1.0);

            var smaillfinish = cc.callFunc(function () {

                that.bageAllScrollView.active = false;
            });

            var seq2 = cc.sequence(changesmail, smaillfinish);
            this.bageCloseBtn.node.runAction(seq2);
        }, this);

        var seq = cc.sequence(changebig, finish);

        this.bageCloseBtn.node.runAction(seq);
    },

    onLoad: function onLoad() {},
    init: function init() {

        var that = this;
        cc.loader.load({ url: "https://h5.taoqi001.com/minigames/mouse_click/mouseImage/tasktitle.png", type: 'png' }, function (err, img) {
            var mylogo = new cc.SpriteFrame(img);

            that.moretitleSprite.getComponent(cc.Sprite).spriteFrame = mylogo;
        });

        if (this.items.length > 0) {
            this.node.removeAllChildren();
        }

        var that = this;
        _XmlHttpTool2.default.NhttpPost("/marmot/task_list", {}, function (res) {

            that.items = res;
            console.log("任务列表", res);
            if (res.tip) {
                console.log("数组为0");
                that.emptyView.active = true;
                that.emptyLabel.active = true;
            }

            for (var i = 0; i < that.items.length; ++i) {

                var item = cc.instantiate(that.itemPrefab);
                that.node.addChild(item);
                item.getComponent('taskPrefab').init(that.items[i]);
            }
        });
    },
    start: function start() {}
});

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=taskScrollview.js.map
        